<template>
	<view class="theme-page-bg">
		<view class="bg-fixed padding-20">
			<text class="font24 color-w flex flex-center">累计预估收入</text>
			<view class="font48 color-w flex flex-center f-b m-t-20">¥3455.00</view>
			<view class="border-r32 bg-w m-t-30" style="position: relative;z-index: 2;">
				
				<TeamItem :dataItem="myEarnings" />
			</view>
		</view>
		<view class="padding-20 search-box">
			<SearchBox :showButton="true" placeholder="输入订单号查询" />
		</view>
		<ScrollView
			:contentHeight="contentHeight"
			class="m-t-20 padding-20"
		>
			<template #content>
				<view v-for="(item, index) in orderList" :key="index">
					<OrderItem :dataItem="item" />
				</view>
			</template>
		</ScrollView>
	</view>
</template>

<script setup lang="ts">
	import { ref } from 'vue';
	import type { Ref } from 'vue'
	import SearchBox from '@/components/house/tabbar/index/searchBox/search-box.vue';
	import ScrollView from '@/components/accompany/scrollView/scrollView.vue';
	import TeamItem from '../components/teamItem/index.vue';
	import OrderItem from '@/components/accompany/tabbar/order/orderItem/index.vue'
	import { onLoad } from '@dcloudio/uni-app';
	const contentHeight:Ref<number> = ref(0)	
	
	onLoad (() => {
		console.log('onLoad')
		let sysInfo = uni.getStorageSync('sysInfo')
		contentHeight.value = sysInfo.screenHeight - sysInfo.statusBarHeight - 44 - 378/sysInfo.devicePixelRatio
		console.log(contentHeight)
	})
	const myEarnings = ref({
			commission: '6666.00',
			awardMoney: 33,
			leftLable: '产品收益',
			rightLabel: '团队津贴'
		})
	const list = ref([
		
		{ avatar: 'https://img0.baidu.com/it/u=1385079478,4019721997&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
			teamName: '用户名称',
			commission: '6666.00',
			teamNum: '66',
			awardMoney: 66
		}
	])
	const orderList = ref(
		[
			{
				orderSn: '12345667786',
				status: '1',
				pic: 'https://img0.baidu.com/it/u=2022043590,1237511079&fm=253&fmt=auto&app=120&f=JPEG?w=889&h=500',
				name: '打针-1次3针',
				content: '购买人：海上钢琴师',
				time: '2023-02-01'
			}
		]
	)
</script>

<style lang="scss" scoped>
	.bg-fixed {
		left: 0;
		right: 0;
		top: 0;
		padding-top: 30rpx;
		height: 228rpx;
		background-color: #3FA897;
	}
	.border-r32 {
		border-radius: 32rpx;
	}
	.search-box {
		margin-top: 90rpx;
	}
</style>
